<td><?php echo $invoice->getIssueDate()?></td>
<td>
  <?php 
    echo 
      link_to(
        $invoice->getInvoiceType().'-'.$invoice->getInvoiceId(),
        'invoice/edit?invoice_iden='.$invoice->getInvoiceIden(),
        array('id'=>'link_invoice_'.$invoice->getInvoiceIden(),)
      )
  ?>
  <script language="javascript">
    switch(invoiceDialogMode){
      case 10:
        $('#<?php echo 'link_invoice_'.$invoice->getInvoiceIden()?>').click(
          function(e){
            $.get(
              'debitMemo/create',
              {"invoice_iden":"<?php echo $invoice->getInvoiceIden()?>",},
              function(content){
                $('#ajMain').html(content);
              }
            );
            e.preventDefault();
          }
        );
        break;
      case 20:
        $('#<?php echo 'link_invoice_'.$invoice->getInvoiceIden()?>').click(
          function(e){
            $.get(
              'creditMemo/create',
              {"invoice_iden":"<?php echo $invoice->getInvoiceIden()?>",},
              function(content){
                $('#ajMain').html(content);
              }
            );
            e.preventDefault();
          }
        );
        break;
    }
  </script>
</td>
<td><?php echo $invoice->getInvoiceName()?></td>
<td style="text-align:right;"><?php echo number_format($invoice->getTotal(),2)?></td>
<?php $transaction_list = $invoice->getTransactions()?>
<td style="text-align:right;"><?php echo number_format($transaction_list['DEBIT MEMO'],2)?></td>
<td style="text-align:right;"><?php echo number_format($transaction_list['CREDIT MEMO'],2)?></td>
<td style="text-align:right;"><?php echo number_format($transaction_list['PAYMENT'],2)?></td>
<td style="text-align:right;"><?php echo number_format($transaction_list['OTHERS'],2)?></td>
<td style="text-align:right;"><?php echo number_format($invoice->getTotal()+$transaction_list['DEBIT MEMO']+$transaction_list['CREDIT MEMO']+$transaction_list['PAYMENT']+$transaction_list['OTHERS'],2)?></td>
<td style="text-align:center;"><?php echo $invoice->getDocument()->getVoid()?></td>
<td></td>